<?php $izdelkiHelper = $this->getHelper('Izdelki'); ?>
<?php $strankaSession = new Zend_Session_Namespace('Store_Stranke'); ?>


<div id="view-content">
<?php $izdelki = $izdelkiHelper->getIzdelki(); ?>
    <table id="izdelki-grid" class="table">
        <tr>
            <th>Slika</th><th>Ime izdelka</th><th>Cena</th><th>Podrobnosti</th><th>Dodaj v kosarico</th>
        </tr>
        <?php foreach ($izdelki as $izdelek): ?>
        
        <?php if ($izdelek->jeNaVoljo()): ?>
        
            <tr>
                <td><img src="<?php echo $this->baseUrl() ."/". $izdelek->getThumbNail() ?>" /></td>
                <td><?php echo $izdelek->getIme() ?></td>
                <td><?php echo $izdelek->getCena().' €' ?></td>
                <td><a href="<?php echo $izdelek->getDetailsUrl($this->baseUrl()) ?>"> Prikazi</a></td>
                <?php if ($strankaSession->strankaId): ?>
                    <td><a href="<?php echo $izdelek->getDodajKosaricaUrl($this->baseUrl()) ?>"> Dodaj</a></td>
                <?php else :?>
                    <td>Za nakup potrebna prijava!</td>
                <?php endif; ?>   
            </tr>
            
        <?php endif; ?>    
        <?php endforeach; ?>
    </table>
    
</div>